from django.urls import path
from rest_framework_jwt.views import obtain_jwt_token
from users import views

urlpatterns = [
    path('department/',views.DepartmentView.as_view()),
    path('department/<int:pk>/',views.DepartmentInfoView.as_view()),
    # 登录 测试
    # path('login/',obtain_jwt_token),
    # 发送验证码
    path('sms_code/',views.SmsAPIView.as_view()),
    # 登录
    path('logincount/',views.LoginAPIView.as_view()),
    # 统计用户总数
    path('total_count/',views.UserTotalCount.as_view()),
    # 统计日增用户总数
    path('day_increment/',views.UserDayIncrement.as_view()),
    # 统计日活用户总数
    path('day_live/',views.UserDayLive.as_view()),
    # 上传头像
    path('up_avatar/',views.Headers.as_view())
]


from rest_framework import routers
router = routers.SimpleRouter()
router.register('duty',views.DutyAPIView)
router.register('staff',views.StaffView)
router.register('users',views.UserInfoViewSet)
router.register('avatar',views.HeadImg)
router.register('permissions',views.PermissionViewSet)
router.register('permissiontype',views.RoleViewSet)
urlpatterns += router.urls

